#pragma once

#define RFRAMEBUFFER_MAX_COLORS 4

class RFramebuffer
{
	friend class FramebufferRequest;
public:
	RFramebuffer();
	~RFramebuffer();

	void		Bind();
	static void Unbind();
	
	int			GetWidth();
	int			GetHeight();

	RTexture*	GetColor(uint i);
	RTexture*	GetDepthstencil();

private:
	uint		m_width;
	uint		m_heigth;

	uint		m_clearFlag;
	uint		m_handle;

	void		AddTarget(RTexture* texture);

	RTexture*	m_color[RFRAMEBUFFER_MAX_COLORS];
	RTexture*	m_depthstencil;
};